package com.chy.线程;

public class StringBuilderTest {

    public static StringBuilder sb = new StringBuilder();

    public static void main(String[] args) throws InterruptedException {
        Runnable runnable1 = new Runnable() {
            @Override
            public void run() {
                StringBuilderTest.sb.append(1);
            }
        };
        Runnable runnable2 = new Runnable() {
            @Override
            public void run() {
                StringBuilderTest.sb.append(2);
            }
        };
        new Thread(){
            @Override
            public void run() {
                StringBuilderTest.sb.append(3);
            }
        }.start();
        new Thread(runnable1).start();
        new Thread(runnable2).start();

        Thread.sleep(30);
        System.out.println(sb.toString());
    }


}

